﻿#region Header
// ------------------------ Licence / Copyright ------------------------
// 
// Simple Service Administration Tool for WinNT based systems.
// Copyright © 2010 - Silvan Gehrig
// 
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// 
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
// 
// Author:
//  Silvan Gehrig
//
// ---------------------------------------------------------------------
#endregion

#region Usings

using System;

using SSATool.DL.ServiceModel;

#endregion

namespace SSATool.DL.Server
{
    /// <summary>
    /// Represents the service context.
    /// </summary>
    public class ServiceContext
    {
        #region Declarations
        //--------------------------------------------------------------------
        // Declarations
        //--------------------------------------------------------------------

        /// <summary>
        /// Gets the one and only ServiceContext instance.
        /// </summary>
        public static readonly ServiceContext Current = new ServiceContext();

        #endregion

        #region Properties
        //--------------------------------------------------------------------
        // Properties
        //--------------------------------------------------------------------

        /// <summary>
        /// Gets the port of the service registration.
        /// </summary>
        public int ServicePort
        {
            get { return 8080; }
        }

        /// <summary>
        /// Gets the url of the service registration.
        /// </summary>
        public string ServiceUrl
        {
            get { return "localhost:" + ServicePort; }
        }

        /// <summary>
        /// Gets the service process manager which provides
        /// the required service management functionalities.
        /// </summary>
        public ServiceProcessManager ServiceProcessManager
        {
            get;
            private set;
        }

        #endregion

        #region Constructors / Destructor
        //--------------------------------------------------------------------
        // Constructors / Destructor
        //--------------------------------------------------------------------

        /// <summary>
        /// Initializes a new instance of the <see cref="ServiceContext"/> class.
        /// </summary>
        private ServiceContext()
        {
            ServiceProcessManager = new ServiceProcessManager();
        }

        #endregion

        #region Methods
        //--------------------------------------------------------------------
        // Methods
        //--------------------------------------------------------------------

        #endregion

        #region Events
        //--------------------------------------------------------------------
        // Events
        //--------------------------------------------------------------------

        #endregion
    }
}
